/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */

package l1j.server.server.serverpackets;

// Referenced classes of package l1j.server.server.serverpackets:
// ServerBasePacket

public class S_CharPacks extends ServerBasePacket {
	private static final String S_CHAR_PACKS = "[S] S_CharPacks";

	public S_CharPacks(final String name, final String clanName,
			final int type, final int sex, final int lawful, final int hp,
			final int mp, final int ac, final int lv, final int str,
			final int dex,
			// TODO 角色誕生by99團隊
			final int con, final int wis, final int cha, final int intel,
			final int accessLevel, final int birthday) {
		// TODO 角色誕生by99團隊
		this.writeC(S_OPCODE_CHARLIST);
		this.writeS(name);
		this.writeS(clanName);
		this.writeC(type);
		this.writeC(sex);
		this.writeH(lawful);
		this.writeH(hp);
		this.writeH(mp);
		this.writeC(ac);
		this.writeC(lv);
		this.writeC(str);
		this.writeC(dex);
		this.writeC(con);
		this.writeC(wis);
		this.writeC(cha);
		this.writeC(intel);
		this.writeC(0);// TODO 3.5C (is Administrator)by99團隊
		this.writeD(birthday);// TODO 角色誕生by99團隊
		final int checkcode = lv ^ str ^ dex ^ con ^ wis ^ cha ^ intel;
		this.writeC(checkcode & 0xFF);
	}

	@Override
	public byte[] getContent() {
		return this.getBytes();
	}

	@Override
	public String getType() {
		return S_CHAR_PACKS;
	}
}
